﻿#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLuaBase.lua_CSFunction;
#endif

using XLua;
using System.Collections.Generic;


namespace XLua.CSObjectWrap
{
    using Utils = XLua.Utils;
    public class YoozooGameplayTimeUtilsWrap 
    {
        public static void __Register(RealStatePtr L)
        {
			ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			System.Type type = typeof(Yoozoo.Gameplay.TimeUtils);
			Utils.BeginObjectRegister(type, L, translator, 0, 0, 0, 0);
			
			
			
			
			
			
			Utils.EndObjectRegister(type, L, translator, null, null,
			    null, null, null);

		    Utils.BeginClassRegister(type, L, __CreateInstance, 12, 1, 1);
			Utils.RegisterFunc(L, Utils.CLS_IDX, "GetServerTimeMs", _m_GetServerTimeMs_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "GetServerTime", _m_GetServerTime_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "GetClientTickTimeMS", _m_GetClientTickTimeMS_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "GetClientTickTime", _m_GetClientTickTime_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "UpdateServerTimeStamp", _m_UpdateServerTimeStamp_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "GetTimeStampYMDHM", _m_GetTimeStampYMDHM_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "GetUMTTimeStampYMDHM", _m_GetUMTTimeStampYMDHM_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "MillisecondsToTime", _m_MillisecondsToTime_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "GetLocalDataTimeByUtcTime", _m_GetLocalDataTimeByUtcTime_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "GetUTC2LocalDeltaMilliseconds", _m_GetUTC2LocalDeltaMilliseconds_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "GetUTCTimeStampYMDHM", _m_GetUTCTimeStampYMDHM_xlua_st_);
            
			
            
			Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "clientStartTick", _g_get_clientStartTick);
            
			Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "clientStartTick", _s_set_clientStartTick);
            
			
            Utils.RegisterFunc(L, Utils.CLS_IDX, "New", __CreateInstanceNew);
			Utils.EndClassRegister(type, L, translator);
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstance(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				if(LuaAPI.lua_gettop(L) == 1)
				{
					
					var gen_ret = new Yoozoo.Gameplay.TimeUtils();
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
			}
            return LuaAPI.luaL_error(L, "invalid arguments to Yoozoo.Gameplay.TimeUtils constructor!");
            
        }

        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstanceNew(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				if(LuaAPI.lua_gettop(L) == 0)
				{
					
					var gen_ret = new Yoozoo.Gameplay.TimeUtils();
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
			}
            return LuaAPI.luaL_error(L, "invalid arguments to Yoozoo.Gameplay.TimeUtils constructor!");
            
        }

        
		
        
		
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetServerTimeMs_xlua_st_(RealStatePtr L)
        {
		    try {
            
            
            
                
                {
                    
                        var gen_ret = Yoozoo.Gameplay.TimeUtils.GetServerTimeMs(  );
                        LuaAPI.lua_pushint64(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetServerTime_xlua_st_(RealStatePtr L)
        {
		    try {
            
            
            
                
                {
                    
                        var gen_ret = Yoozoo.Gameplay.TimeUtils.GetServerTime(  );
                        LuaAPI.lua_pushint64(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetClientTickTimeMS_xlua_st_(RealStatePtr L)
        {
		    try {
            
            
            
                
                {
                    
                        var gen_ret = Yoozoo.Gameplay.TimeUtils.GetClientTickTimeMS(  );
                        LuaAPI.lua_pushint64(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetClientTickTime_xlua_st_(RealStatePtr L)
        {
		    try {
            
            
            
                
                {
                    
                        var gen_ret = Yoozoo.Gameplay.TimeUtils.GetClientTickTime(  );
                        LuaAPI.lua_pushnumber(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_UpdateServerTimeStamp_xlua_st_(RealStatePtr L)
        {
		    try {
            
            
            
                
                {
                    long _timeStamp = LuaAPI.lua_toint64(L, 1);
                    
                    Yoozoo.Gameplay.TimeUtils.UpdateServerTimeStamp( _timeStamp );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetTimeStampYMDHM_xlua_st_(RealStatePtr L)
        {
		    try {
            
            
            
                
                {
                    int _year = LuaAPI.xlua_tointeger(L, 1);
                    int _month = LuaAPI.xlua_tointeger(L, 2);
                    int _day = LuaAPI.xlua_tointeger(L, 3);
                    int _hour = LuaAPI.xlua_tointeger(L, 4);
                    int _minutes = LuaAPI.xlua_tointeger(L, 5);
                    
                        var gen_ret = Yoozoo.Gameplay.TimeUtils.GetTimeStampYMDHM( _year, _month, _day, _hour, _minutes );
                        LuaAPI.lua_pushint64(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetUMTTimeStampYMDHM_xlua_st_(RealStatePtr L)
        {
		    try {
            
            
            
                
                {
                    int _year = LuaAPI.xlua_tointeger(L, 1);
                    int _month = LuaAPI.xlua_tointeger(L, 2);
                    int _day = LuaAPI.xlua_tointeger(L, 3);
                    int _hour = LuaAPI.xlua_tointeger(L, 4);
                    int _minutes = LuaAPI.xlua_tointeger(L, 5);
                    
                        var gen_ret = Yoozoo.Gameplay.TimeUtils.GetUMTTimeStampYMDHM( _year, _month, _day, _hour, _minutes );
                        LuaAPI.lua_pushint64(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_MillisecondsToTime_xlua_st_(RealStatePtr L)
        {
		    try {
            
            
            
                
                {
                    long _milliseconds = LuaAPI.lua_toint64(L, 1);
                    
                        var gen_ret = Yoozoo.Gameplay.TimeUtils.MillisecondsToTime( _milliseconds );
                        LuaAPI.lua_pushstring(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetLocalDataTimeByUtcTime_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
                
                {
                    int _year = LuaAPI.xlua_tointeger(L, 1);
                    int _month = LuaAPI.xlua_tointeger(L, 2);
                    int _day = LuaAPI.xlua_tointeger(L, 3);
                    int _hour = LuaAPI.xlua_tointeger(L, 4);
                    int _minutes = LuaAPI.xlua_tointeger(L, 5);
                    int _second = LuaAPI.xlua_tointeger(L, 6);
                    
                        var gen_ret = Yoozoo.Gameplay.TimeUtils.GetLocalDataTimeByUtcTime( _year, _month, _day, _hour, _minutes, _second );
                        translator.Push(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetUTC2LocalDeltaMilliseconds_xlua_st_(RealStatePtr L)
        {
		    try {
            
            
            
                
                {
                    
                        var gen_ret = Yoozoo.Gameplay.TimeUtils.GetUTC2LocalDeltaMilliseconds(  );
                        LuaAPI.lua_pushint64(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetUTCTimeStampYMDHM_xlua_st_(RealStatePtr L)
        {
		    try {
            
            
            
                
                {
                    int _year = LuaAPI.xlua_tointeger(L, 1);
                    int _month = LuaAPI.xlua_tointeger(L, 2);
                    int _day = LuaAPI.xlua_tointeger(L, 3);
                    int _hour = LuaAPI.xlua_tointeger(L, 4);
                    int _minutes = LuaAPI.xlua_tointeger(L, 5);
                    bool _isUTC = LuaAPI.lua_toboolean(L, 6);
                    
                        var gen_ret = Yoozoo.Gameplay.TimeUtils.GetUTCTimeStampYMDHM( _year, _month, _day, _hour, _minutes, _isUTC );
                        LuaAPI.lua_pushint64(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_clientStartTick(RealStatePtr L)
        {
		    try {
            
			    LuaAPI.lua_pushint64(L, Yoozoo.Gameplay.TimeUtils.clientStartTick);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 1;
        }
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_clientStartTick(RealStatePtr L)
        {
		    try {
                
			    Yoozoo.Gameplay.TimeUtils.clientStartTick = LuaAPI.lua_toint64(L, 1);
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 0;
        }
        
		
		
		
		
    }
}
